package net.dgg.rz.common.utils;

/**
 * 身份证号隐藏中间数字（前3后3显示中间*代替）
 * @author cuipeng
 *
 */
public class IdCardUtil {

    public static String hiddenIdCard(String IdCard){
        StringBuilder sb = new StringBuilder();
        if(StringUtils.isNotEmpty(IdCard) && IdCard.length() > 6){
            sb.append(IdCard.substring(0,3)).append("************")
                    .append(IdCard.substring(IdCard.length()-3,IdCard.length()));
        }else{
            sb.append("******");
        }
        return sb.toString();
    }

}
